<table>
<tr>
    <th>Id</th>
    <th>Naziv</th>
    <th>Kategorija</th>
    <th></th>
</tr>

<? if(! empty($data)): ?>
    <? foreach($data as $row): ?>
    <tr>
        <td><?= $row->Product->id ?></td>
        <td><?= $this->link($row->Product->name, "/admin_products/edit/{$row->Product->id}/{$row->Category->id}", array(
            'remote' => true,
            'data'   => array('complete' => 'loadContent(req)')
        )) ?></td>
        <td><?= $row->Category->name ?></td>
        <td><?= $this->link('x', "/admin_products/remove/{$row->Product->id}", array(
            'confirm' => 'Da li želite da obrišete proizvod?'
        )) ?></td>
    </tr>
    <? endforeach ?>
<? else: ?>
<tr>
    <td colspan="3">Nema proizvoda.</td>
</tr>
<? endif ?>
</table>

<script type="text/javascript">
$(function(){
    initRemoteLinks($('table [data-remote]'));
});
</script>